	Event Flags

This a list of flags which affect handling of certain objects, events, etc. I listed the ones used/referenced
in the game; I also included that last ones because they are part of the scene data, but they don't seem to be ever used.
Those that I didn't list are free spots and can be used however you want.
These are offsets of memory location $FFBF00 (event_flags in the constants file) through $FFBFFF. Offset $00 is always set when the game
starts running and the offset $FF is always cleared. For the script text handling, for example, this is necessary otherwise it won't work correctly.
You can use the offsets below and tweak the game script by choosing what flag is set and run different dialogues accordingly. Check the small tutorial
on the game script (find "Main Game Script Area" in the disassembly). The Scene_UpdateDataOffs data uses the event flag offsets as well, so check that out
as well. Of course you can change the functionality and handling of these flags in the assembly code.
	
0 = Set at the start of the game ; always set
2 = Counter incremented whenever a new dialogue box opens for events/demos
3 = Set immediately after dragon and Maia disappear
4 = Set as soon as Rhys enters the Landen dungeon prison and the door is closed
5 = Set as soon as you start the Rhys and Lena dialogue in the Landen dungeon
6 = Set after the prison door in the Landen dungeon opens
7 = Set after the escape from Landen dungeon demo finishes
8 = Set as you talk to the guy who says: "I saw one of Laya's people at the lake..."; triggers Mieu
9 = Set after talking to Mieu
A = Set after talking to the old man in Yaata
B = Incremented after each ride on the old man's boat; if the value is even, you are on the shore near Yaata, odd on the other side
C = Set when you talk to Lyle in the island cave
D = Set when talking to a cyborg that says: "the one you seek abides..."; it's supposed to trigger Wren probably,
    but Wren will show up either way
E = Set when talking to Wren
F = Set after talking to Lyle in the Control Tower
10 = Set when fixing the weather control system
11 = Incremented after each ride on the boat from Rysel to Agoe/Shusoran; if the value is even, you are on the shore near Rysel, odd on the other side
12 = Set when talking to Lena in the castle of Shusoran
13 = Set when placing the Moon Stone and Moon Tear on the satellite control system
14 = Set after the battle with the king of Cille
15 = Set after choosing to marry Maia
16 = Set after choosing to marry Lena
18 = Cleared when you're playing as Rhys; set otherwise
19 = Set after Sega screen; cleared when Ayn's quest starts
1A = Set after Sega screen; cleared when Nial's quest starts
1B = Set after Sega screen; cleared when Sean's quest starts
1C = Set after Sega screen; cleared when Crys's quest starts
1D = Set after Sega screen; cleared when Adan's quest starts
1E = Set after Sega screen; cleared when Aron's quest starts
1F = Set after Sega screen
20 = Set when Ayn's quest starts
21 = Set when Ayn starts talking to Rhys
22 = Set when you gain control of Ayn for the first time
23 = Set when you land the boat on the ride from Shusoran to Rysel in Ayn's generation
24 = Same as 23
25 = Set when talking to the guy who tried to save Thea in Endora (he's called Quist in the Japanese version)
26 = Set when opening the bottom prison door in the Lensol dungeon
27 = Set when opening the top prison door in the Lensol dungeon
28 = Set when you talk to Thea in the Lensol dungeon
29 = Set after the battle with Sari
2A = Set after Lyle takes you to Techna in dragon form
30 = Set when boarding the spaceship to Azura
31 = Set when leaving for Azura
34 = Set when the screen to marry Thea or Sari appears
35 = Set when choosing to marry Thea
36 = Set when choosing to marry Sari
40 = Set when Nial quest starts before gaining control
41 = Set when the dialogue between Rhys and Nial starts
42 = Set when gaining control of Nial for the first time
47 = Set after opening the top prison door in the Divisia dungeon
48 = Set after opening the bottom prison door in the Divisia dungeon
49 = Set when talking to Alair in the Divisia dungeon
4A = Set when Lune appears in the rebels' cave
4B = Set when Ryan turns around to face Lune and speaks
4C = Set when Lune disappears in the rebels' cave
4D = Set when Ryan speaks to you after Lune leaves
4E = Set after talking to Ryan and he joins
4F = Set in Nial's generation after talking to Laya and she joins
50 = Set as soon as you board the spaceship to Dahlia
51 = Set when leaving for Dahlia
55 = Set after choosing to marry Laya
56 = Set after choosing to marry Alair
60 = Set when Sean quest starts
61 = Set when Sean, Mieu and Wren leave Azura
62 = Set when you gain control of Sean for the first time
80 = Set when Crys quest starts
81 = Set when you gain control of Crys for the first time
88 = Set after warrior Kara joins (both Sean and Crys)
A0 = Set when Adan generation starts
A1 = Set when you gain control of Adan for the first time
A8 = Set when Kara joins in Adan's generation
C0 = Set when Aron generation starts
C1 = Set when you gain control of Aron for the first time
E3 = Set when you pull the Orakio Sword
E4 = Set when you talk to Miun with the Orakio Sword
E5 = Set when talking to Siren in Sage Isle
E6 = Set when the sage reveals the ancient word
E7 = Set when the sage on Skyhaven says that Nei is the word of ultimate power (Nei weapons)
E8 = Set after defeating Rulakir
E9 = Set when talking to Siren in Sage Isle (same as E5)
EA = Set when opening the Dark Force treasure chest
EB = Referenced in the Scene_UpdateDataOffs, but it's never used in the code
EC = Referenced in the Scene_UpdateDataOffs, but it's never used in the code
-------------------------------------------------------------------------------

	Scene indexes

This is a list of indexes for the scenes and the index is saved at memory location $FFD022; I named it scene_id.
This index is used when accessing different look-up tables necessary for graphics, sprites, etc. Some tables this is used for are
LevelNPCSpriteOffset, Scene_UpdateDataOffs, Scene_GraphicsOffset. 
Some scene IDs don't make sense for some generations, but I included them because the Scene_UpdateDataOffs data references the generations that can use the scene. 
For instance Azura is only accessible to Ayn and Sean (not controllable), however data referencing Adan and Aron generation is also present.
Scene 30 is never used because it's immediately overriden when playing as the other generation characters; it's implied that in Rhys generation game designers
wanted to use the Landen-Aridia cave for Rhys, but later decided to scrap it.

0 = Landen world map
2 = Aridia world map
4 = Aquatica world map (frozen)
6 = Draconia world map
8 = Terminus world map
A = Fridigia world map
C = Elysium world map
E = Aquatica world map normal
10 = Ayn Landen world map
12 = Nial Dahlia
14 = Ayn Azura
2C = Landen-Aquatica cave
2E = Aquatica-Aridia cave
30 = Landen-Aridia cave (presumably for Rhys, but there's no way to enter it)
38 = Aridia Control Tower
3A = Aridia Control Tower 1F
3C = Landen castle
3E = Satera
40 = Sunken palace
42 = Agoe castle
44 = Shusoran castle
46 = Cille castle
48 = Lensol castle (can't get there)
4A = Ayn Cille castle
4C = Ayn Cille castle empty
4E = Ayn Lensol castle (when castle gates are closed... means you can't get there)
50 = Ayn Lensol castle castle gates open
52 = Techna castle
54 = Ayn Landen castle before Sari
56 = Ayn Landen castle after Sari
58 = Shusoran castle when Lena joins
5A = Landen
5C = Yaata 
5E = Ilan 
60 = Rysel (frozen)
62 = Hazatak 
64 = Agoe
66 = Shusoran
68 = Cille
6A = Ayn Landen
6C = Ayn Landen with Sari
6E = Ayn Yaata
70 = Ayn Ilan
72 = Shusoran after Lena joins
74 = Rysel normal
76 = Landen after wedding
78 = Landen dungeon
7A = Landen island cave
7C = Ayn Landen dungeon
7E = Ayn Landen dungeon when you have Sari
80 = Wren's cave
82 = Nial and 3rd generation Landen dungeon
84 = Ayn Landen island cave (no way to get there to the best of my knowledge)
86 = Shusoran dungeon
88 = Cille dungeon
8A = Nial and 3rd generation Landen island cave (no way to get there)
8C = Ayn Landen-Aquatica cave
8E = Nial Landen-Aquatica cave
90 = Ayn Aquatica-Aridia cave
92 = Nial Aquatica-Aridia cave
94 = Ayn and 3rd generation Wren's cave (for Ayn it's before event flag at offset $24 is set, but you can't get there before that)
96 = Ayn Wren's cave
98 = Nial Wren's cave
9A = Ayn Control Tower
9C = Nial and 3rd generation Control Tower
9E = Ayn Control Tower 1F
A0 = Nial and 3rd generation Control Tower 1F
A2 = Ayn and 3rd generation Shusoran dungeon
A4 = Ayn and 3rd generation Cille dungeon (can't get there in 3rd generation)
A8 = Lensol dungeon
AA = Ayn Lensol dungeon after Thea joins; Nial and 3rd generation as well
AC = Techna dungeon
AE = Nial Mystoke castle dungeon
B0 = Divisia dungeon
B2 = Shusoran dungeon with Lena
B4 = Lashute evil
B6 = Laya Temple where you teleport to other worlds
BA = Aridia Laya's world
C0 = Landen tech store
C2 = Landen armor store
C4 = Landen weapon store
C6 = Landen inn
C8 = Landen supply store
CA = Landen church
CC = Landen Fortune teller house
CE = Landen top right house 
D0 = Landen top right house 2
D2 = Landen tech store 1F
D4 = Landen armor store 1F
D6 = Landen weapon store 1F
D8 = Landen inn 1F
DA = Landen supply store 1F
DC = Landen church 1F
DE = Landen Fortune teller house 1F
E0 = Landen top right house 1F
E2 = Landen top right house 2 1F
E4 = Yaata bottom left house
E6 = Yaata inn
E8 = Yaata supply store
EA = Yaata weapon store
EC = Yaata tech store
EE = Yaata church
F0 = Yaata armor store
F2 = Yaata bottom left house 1F
F4 = Yaata inn 1F
F6 = Yaata supply store 1F
F8 = Yaata weapon store 1F
FA = Yaata tech store 1F
FC = Yaata church 1F
FE = Yaata armor store 1F
100 = Ilan weapon store
102 = Ilan armor store
104 = Ilan inn
106 = Ilan supply store
108 = Ilan church
10A = Ilan tech store
10C = Ilan top right house
10E = Ilan weapon store 1F
110 = Ilan armor store 1F
112 = Ilan inn 1F
114 = Ilan supply store 1F
116 = Ilan church 1F
118 = Ilan tech store 1F
11A = Ilan top right house 1F
11C = Rysel supply store
11E = Rysel inn
120 = Rysel church
122 = Rysel tech store
124 = Rysel weapon store
126 = Rysel armor store
128 = Rysel top right house
12A = Rysel supply store 1F
12C = Rysel inn 1F
12E = Rysel church 1F
130 = Rysel tech store 1F
132 = Rysel weapon store 1F
134 = Rysel armor store 1F
136 = Rysel top right house 1F
138 = Hazatak armor store
13A = Hazatak supply store
13C = Hazatak inn
13E = Hazatak top left house
140 = Hazatak tech store 
142 = Hazatak weapon store
144 = Hazatak armor store 1F
146 = Hazatak supply store 1F
148 = Hazatak inn 1F
14A = Hazatak top left house 1F
14C = Hazatak tech store 1F
14E = Hazatak weapon store 1F
150 = Agoe tech store
152 = Agoe supply store
154 = Agoe inn
156 = Agoe bottom right house
158 = Agoe weapon store
15A = Agoe armor store
15C = Agoe church
15E = Agoe tech store 1F
160 = Agoe supply store 1F
162 = Agoe inn 1F
164 = Agoe bottom right house 1F
166 = Agoe weapon store 1F
168 = Agoe armor store 1F
16A = Agoe church 1F
16C = Shusoran tech store
16E = Shusoran church
170 = Shusoran inn
172 = Shusoran weapon store
174 = Shusoran armor store
176 = Shusoran supply store
178 = Shusoran tech store 1F
17A = Shusoran church 1F
17C = Shusoran inn 1F
17E = Shusoran weapon store 1F
180 = Shusoran armor store 1F
182 = Shusoran supply store 1F
184 = Cille tech store
186 = Cille church
188 = Cille inn
18A = Cille armor store
18C = Cille supply store
18E = Cille weapon store
190 = Cille tech store 1F
192 = Cille church 1F
194 = Cille inn 1F
196 = Cille armor store 1F
198 = Cille supply store 1F
19A = Cille weapon store 1F
19C = Ayn Agoe castle
19E = Ayn Shusoran castle
1A0 = Ayn and 3rd generation Shusoran castle empty
1A2 = Nial Landen castle
1A4 = Nial Mystoke castle
1A6 = Divisia castle
1A8 = Sean Landen castle
1AA = Crys Landen castle
1AC = Adan Landen castle
1AE = Aron Landen castle
1B0 = 3rd generation Satera
1B2 = 3rd generation Agoe castle
1B4 = 3rd generation Cille castle (don't think you can get there though)
1B6 = Sean/Crys Lensol castle
1B8 = 3rd generation Lensol castle
1BA = 3rd generation Techna castle
1BC = Ayn Rysel 
1BE = Ayn Hazatak 
1C0 = Ayn Agoe 
1C2 = Ayn Shusoran 
1C4 = Ayn Cille 
1C6 = Ayn Techna 
1C8 = Endora 
1CA = Lensol 
1CC = Ayn Lensol gates open
1CE = Nial Landen 
1D0 = Nial Yaata 
1D2 = Nial Ilan 
1D4 = Nial and 3rd generation Hazatak 
1D6 = Ayn and 3rd generation Shusoran empty
1D8 = Ayn and 3rd generation Cille empty (can't get there in 3rd generation)
1DA = 3rd generation Techna
1DC = Mystoke
1DE = South Divisia 
1E0 = Aerone 
1E2 = New Mota
1E4 = Ayn Aquatica world map
1E6 = Ayn Aridia world map
1E8 = Nial and 3rd generation Landen world map
1EA = Nial and 3rd generation Aridia world map
1EC = Rebel cave
1EE = Rebel cave after Ryan joins
1F0 = Aerone dungeon
1F2 = Dahlia dungeon before events with Ryan and Lune in the rebels' cave (can't get there at this point)
1F4 = Nial Dahlia dungeon
1F6 = Azura dungeon
1F8 = Aridia-Draconia cave
1FA = Aridia-Frigidia cave
1FC = Nial Landen-Elysium cave
1FE = Ayn Landen-Aridia cave
200 = Nial and 3rd generation Landel-Aridia cave
202 = Rhys menu / Rhys dialogue screen among characters
204 = Ayn menu / Ayn dialogue with Sari
206 = Nial menu / Nial dialogue screen among characters
208 = Sean menu
20A = Crys menu
20C = Adan menu / Dialogue with Gwyn
20E = Aron menu / Aron dialogue with princess Kara
210 = Title
212 = Intro showing how the story started
214 = Sean end game screen
216 = Screen when people in New Mota tell you the story
218 = Screen with the two moons
21A = Crys end game screen
21C = Adan end game screen
21E = Screen with two ship worlds (e.g. shown at the start of Aron's generation)
220 = Aron end game screen
222 = Game select screen / supply store dialogue screen
224 = Weapon store dialogue screen
226 = Armor store dialogue screen
228 = Nurse dialogue screen
22A = Priest dialogue screen
22E = Fortune teller dialogue screen
230 = Inn dialogue screen
232 = Battle
236 = title text after start press
238 = Wren's transformation / End credits
23A = Techna spaceship
23C = Draconia spaceship
23E = Space travel to Azura
240 = Lashute dungeon
242 = Skyhaven dungeon
244 = 3rd generation Divisia dungeon
246 = 3rd generation rebels' cave
248 = Sage Isle
24A = Sage Isle after talking to Siren
24C = 3rd generation Dahlia dungeon
24E = 3rd generation Azura dungeon (cannot get there... maybe it wasn't originally meant to be destroyed?)
250 = 3rd generation Aridia-Draconia cave
252 = 3rd generation Landen
254 = 3rd generation Yaata
256 = 3rd generation Ilan
258 = 3rd generation Rysel
25A = 3rd generation Agoe
25C = Lashute
25E = Skyhaven
260 = Skyhaven when you have the Nei weapons
262 = 3rd generation South Divisia
264 = 3rd generation Aerone
266 = 3rd generation Endora
268 = 3rd generation Lensol
26A = Nial Landen Castle only at the start of his generation
26C = 3rd generation Azura
26E = Crys/Sean Dahlia
272 = Adan Dahlia
276 = Aron Dahlia
27A = 3rd generation Divisia castle
27C = Techna weapon store
27E = Techna armor store
280 = Techna inn
282 = Techna supply store
284 = Techna church
286 = Techna tech store
288 = Techna top right house
28A = North Divisia supply store
28C = North Divisia church
28E = Techna weapon store 1F
290 = Techna armor store 1F
292 = Techna inn 1F
294 = Techna supply store 1F
296 = Techna church 1F
298 = Techna tech store 1F
29A = Techna top right house 1F
29C = North Divisia supply store 1F
29E = North Divisia church 1F
2A0 = Mystoke supply store
2A2 = Mystoke inn
2A4 = Mystoke church
2A6 = Mystoke tech store
2A8 = Mystoke weapon store
2AA = Mystoke armor store
2AC = Mystoke top right house
2AE = North Divisia top left house
2B0 = North Divisia inn
2B2 = Mystoke supply store 1F
2B4 = Mystoke inn 1F
2B6 = Mystoke church 1F
2B8 = Mystoke tech store 1F
2BA = Mystoke weapon store 1F
2BC = Mystoke armor store 1F
2BE = Mystoke top right house 1F
2C0 = North Divisia top left house 1F
2C2 = North Divisia inn 1F
2C4 = South Divisia supply store
2C6 = South Divisia inn
2C8 = South Divisia church
2CA = South Divisia top left house
2CC = South Divisia weapon store
2CE = South Divisia armor store
2D0 = South Divisia top right house
2D6 = South Divisia supply store 1F
2D8 = South Divisia inn 1F
2DA = South Divisia church 1F
2DC = South Divisia top left house 1F
2DE = South Divisia weapon store 1F
2E0 = South Divisia armor store 1F
2E2 = South Divisia top right house 1F
2E8 = Aerone weapon store
2EA = Aerone armor store
2EC = Aerone inn
2EE = Aerone supply store
2F0 = Aerone church
2F2 = Aerone tech store
2F4 = Aerone top right house
2FA = Aerone weapon store 1F
2FC = Aerone armor store 1F
2FE = Aerone inn 1F
300 = Aerone supply store 1F
302 = Aerone church 1F
304 = Aerone tech store 1F
306 = Aerone top right house 1F
30C = New Mota tech store
30E = New Mota supply store
310 = New Mota inn
312 = New Mota bottom right house
314 = New Mota weapon store
316 = New Mota armor store
318 = New Mota church
31E = New Mota tech store 1F
320 = New Mota supply store 1F
322 = New Mota inn 1F
324 = New Mota bottom right house 1F
326 = New Mota weapon store 1F
328 = New Mota armor store 1F
32A = New Mota church 1F
330 = Endora bottom left house
332 = Endora inn
334 = Endora supply store
336 = Endora weapon store
338 = Endora tech store
33A = Endora church
33C = Endora armor store
342 = Endora bottom left house 1F
344 = Endora inn 1F
346 = Endora supply store 1F
348 = Endora weapon store 1F
34A = Endora tech store 1F
34C = Endora church 1F
34E = Endora armor store 1F
354 = Lensol armor store
356 = Lensol church
358 = Lensol inn
35A = Lensol tech store
35C = Lensol supply store
35E = Lensol weapon store
366 = Lensol armor store 1F
368 = Lensol church 1F
36A = Lensol inn 1F
36C = Lensol tech store 1F
36E = Lensol supply store 1F
370 = Lensol weapon store 1F
376 = Monitor screen
378 = 3rd generation Aquatica world map
37A = North Divisia 
37C = 3rd generation North Divisia
37E = Spaceship in Aerone
380 = Spaceship out of Aerone
382 = Space travel to Dahlia
384 = Generation transition
386 = Rhys and Ayn generation transition
388 = Rhys and Nial generation transition
38A = Ayn and Sean generation transition
38C = Ayn and Crys generation transition
38E = Nial and Adan generation transition
390 = Nial and Aron generation transition
392 = Rhys marriage dialogue screen
394 = Ayn dialogue screen with Rhys/Maia
396 = Ayn dialogue with Lyle/Siren
398 = Nial dialogue screen with Rhys and Lena
39A = Dialogue screen when talking to Lune
39C = Screen when choosing to marry either Laya or Alair
39E = Sean dialogue with Ayn/Thea
3A0 = First screen in Sean's quest
3A2 = Second screen in Sean's quest
3A4 = First screen in Crys's quest
3A6 = Adan screen of first image
3A8 = Adan screen of second image
3AA = Aron screen of first image
3AC = Screen depicting spaceship and Azura at the start of Sean's quest
3AE = Start of game
3B0 = Wedding screen after choosing to marry someone
3B2 = Dark Force battle
3B4 = Screen with main character using Megido
3B6 = Screen showing Miew and Wren after Megido
3B8 = Screen with Mieu using Grantz
3BA = Screen with Lashute collapsing
3BE = Crys dialogue screen
3C0 = Adan dialogue with Nial/Laya
3C2 = Aron dialogue with Nial/Alair
3C8 = Adan dialogue with Alair
3CA = Aron dialogue with Lune